Skip to content

Instantly share code, notes, and snippets.

How to add an image to a gist

  1. Create a gist if you haven't already.
  2. Clone your gist:
    # make sure to replace `<hash>` with your gist's hash
    git clone https://gist.github.com/<hash>.git # with https
    git clone git@gist.github.com:<hash>.git     # or with ssh

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Create Free AWS Account

Create free AWS Account at https://aws.amazon.com/

2. Create and Lauch an EC2 instance and SSH into machine

I would be creating a t2.medium ubuntu machine for this demo.

@Xswexx
Xswexx / index.html
Last active May 9, 2024 10:58
On-Scroll Fire Transition (WebGL + GSAP ScrollTrigger)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>موقعي الشخصي</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
@skurfuerst
skurfuerst / gen-types.mjs
Created January 16, 2021 21:10
Generate runtypes from TypeScript definitions using ts-morph
// RUN with a recent node.js version, using "node gen-types.mjs"
// DEPENDS on typescript and ts-morph
import { Project } from "ts-morph";
import { writeFileSync } from "fs";
const project = new Project({
tsConfigFilePath: "tsconfig.json",
});
@artemonsh
artemonsh / tokens.md
Created April 6, 2023 18:10 — forked from zmts/tokens.md
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@yrevar
yrevar / imagenet1000_clsidx_to_labels.txt
Last active May 9, 2024 10:55
text: imagenet 1000 class idx to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',
@azagniotov
azagniotov / beautiful.rest.api.docs.in.markdown.md
Last active May 9, 2024 10:51
Example to create beautiful REST API docs in Markdown, inspired by Swagger API docs.
@hhypnos
hhypnos / index.html
Created March 7, 2017 18:08
Pure CSS3 Boobs
<div class="body">
<div class="chest">
<div class="left"><div class="clavicle"></div></div>
<div class="right"><div class="clavicle"></div></div>
</div>
<div class="breast">
<div class="left"><ul class="boob"><li class="nipple"></li></ul></div>
<div class="right"><ul class="boob"><li class="nipple"></li></ul></div>
<div class="between"></div>
Настройка Git клиента для идентификации пользователя:
git config --global user.name "Your Name"
git config --global user.email "your@email.address"
git config --global core.editor "your editor"
Инициализация репозитория в текущем каталоге:
git init
Создает репозиторий в указанном каталоге:
git init <directory>
@ThomasLeister
ThomasLeister / rspamd-whitelisting.md
Last active May 9, 2024 10:49
How to whitelist IP addresses or domains in Rspamd

Whitelist IP addresses based on pre-filter policy

/etc/rspamd/local.d/multimap.conf:

  IP_WHITELIST {
      type = "ip";
      prefilter = true;
      map = "/${LOCAL_CONFDIR}/local.d/ip_whitelist.map";
 action = "accept";